import { screenAnalysis } from '@/api/screen'

export default function useEnergyOverview() {
  const data = ref<{
    energyName: string
    energyType: string
    energyUnit: string
    data: number
  }[]>([])

  const getEnergyOverview = async () => {
    try {
      const res = await screenAnalysis()
      data.value = res.data || []
    }
    catch (e) {
      console.warn(e)
    }
  }

  return {
    data,
    getEnergyOverview,
  }
}
